AxoCalculator comes with many built in functions and procedures. These are described below. Additional customized functions and procedures can be added. They are written by the user in a high level language (Pascal, Fortran, Basic or C), then loaded into AxoCalculator. Customized functions and procedures can be loaded manually by selecting the source text then pressing "enter". They can also be loaded automatically every time AxoCalculator is run.
Auto-Loading Custom Functions
When AxoCalculator starts up, it looks for a folder called "AxoCalculator AutoLoad" located in the same folder as the program, and attempts to open and load any text files that it finds in this folder. Files containing frequently used custom functions and procedures should be placed in this folder. After unpacking the "AxoCalculator.sea" package, an auto-load folder is created, and contains a several files including "Unit Conversions". When this file is loaded, it adds several custom functions and programs to AxoCalculator.
Built In Functions
Note: The functions in italics are disabled in
the no-FPU version of AxoCalculator
General Functions
abs (x) Absolute value
sqrt (x) Square root
sqr (x) Square
exp (x) Exponential (e raised to the power x)
ln (x) Natural Log (to the base e)
exp10 (x) 10 raised to the power x
log10 (x) Log to the base 10
trunc (x) Next lowest integer
round (x) Nearest integer
odd (i) Returns TRUE if "i" is an odd number
Trigonometric
pi Returns the value of pi (≈ 3.1415926)
Sin (x) Sin
Cos (x) Cos
Tan (x) Tan
Sinh (x) Hyperbolic Sin
Cosh (x) Hyperbolic Cos
Tanh (x) Hyperbolic Tan
ArcSin (x) Inverse Sin
ArcCos (x) Inverse Cos
ArcTan (x) Inverse Tan
Array Functions
av (arr, from, to) Average of array elements
mean (arr, from, to) Same as "av"
variance (arr, from, to) Variance
stdDev (arr, from, to) Standard deviation
stdErr (arr, from, to) Standard error
sd (arr, from, to) Alternative standard deviation
sem (arr, from, to) Alternative standard error
min (arr, from, to) Minimum array element
max (arr, from, to) Maximum array element
count (arr, from, to) Number of elements processed
arraySize (arr) Total number of elements in array
Note: The "from" and "to" parameters are optional.
They specify a range of array elements to be processed.
If they are omitted, the entire array is processed.
Remember that array indexing in C starts from zero,
but in all other languages it starts from one.
Built In Procedures
Text and Numeric Output
• Write ('A string', a, b, c,...)
• WriteLn ('A string', a, b, c,...)
• Print ('A string', a, b, c,...)
• Printf ('A string', a, b, c,...)
These procedures convert their parameter list to a line of text and send it to the front window. "Write" does not add a "return" at the end of the output line. "WriteLn", "Print" and "Printf" are interchangeable. Valid parameters are numerical or logical variables and expressions, and character strings. Any number of parameters may be specified (including none), and strings and numeric variables may appear in any order. Logical variables will be written as "1" (if True) or "0" (if False).
Note: Pascal and Fortran use single quotes ( ' ) to enclose
character strings, but Basic and C use double quotes ( " ).
To include a quote, tab or return in a character string,
use \' or \" for a quote, \t for a tab and \r or \n for a return.
• FlushOutput
Text output from Write, WriteLn and Print is normally accumulated in a buffer and output all at once when a program finishes running. Use FlushOutput to force the output to occur while the program is still running.
Creating Array and String Variables
• NewArray (variableName, arrSize)
This procedure creates a new array of size "arrSize", and sets all elements to zero. It provides an alternative to formally declaring an array variable at the start of a program.
• NewString (variableName)
This procedure creates a new 255 character string. It provides an alternative to formally declaring a string variable at the start of a program. String variables can also be created on the fly. For example,
aString = 'abc123'
User Dialog
• Alert ('A string', a, b, c,...)
This procedure converts its parameter list to a line of text (as for Writeln, Printf, etc.), and sends the text to an alert dialog.
This procedure permits the user to request parameter values via a standard dialog. The parameter list must have the following format. The first parameter is a string containing general information. The next parameter is a string describing the first requested variable. The third parameter is a numeric variable which will receive the requested value. Subsequent parameters are optional, but if present, they must alternate text string, then numeric variable. After executing this procedure, the values entered into the dialog by the user are returned in the numeric variables, "a1", "a2", ...
Array Procedures
• WriteArr (arr, from, to)
Write the contents of the array to the front window
• Stats (arr, from, to)
Calculate the following summary statistics for the specified array and output the results to the front window :
Mean, Variance, S.D., S.E.M., Minimum, Maximum and Count.
Note: the "from" and "to" parameters are optional.
They specify a range of array elements to be processed.
If they are omitted, the entire array is processed.
General Purpose
• beep
Generates the alert sound
• Unload (varName, macroName, functionName, ...)
This procedure unloads all the specified global variables, macros, procedures and functions. It frees up memory space allocated to the arrays and procedures. It also removes the specified macro names from the "Calculator" menu.